package com.qf.microuser.user.controller;

import com.qf.common.core.common.R;
import com.qf.common.core.entity.User;
import com.qf.microuser.user.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * --- 缘分让我们相遇乱世以外 ---
 *
 * @author SJY
 * 2024/12/26
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    /**
     * 获取"我的"信息,不需要传用户id,用户id通过token获取
     */
    @GetMapping("/my")
    public R my() {
        User user = userService.my();
        return R.ok(user);
    }
}
